#include "Task.h"

#include <QThread>
#include <QDebug>

Task::Task()
{
    setAutoDelete(true);
}

Task::~Task()
{
    qDebug() << "~Task() " << idx_;
}

void Task::SetIdx(int idx)
{
    idx_ = idx;
}

void Task::run()
{
    for (int i = 0; i < 10; ++i) {
        qDebug() << "idx:" << idx_ << ". thread:" << QThread::currentThreadId();

        QThread::currentThread()->msleep(1000);
    }
}
